#include "StdAfx.h"
#include "AbilityFactory.h"
#include "Ability.h"


AbilityFactory::AbilityFactory()
{
	m_pAbilityPool = new CMemoryPoolFactory<Ability>;
}

AbilityFactory::~AbilityFactory()
{
	SAFE_DELETE( m_pAbilityPool );
}

VOID AbilityFactory::Release()
{
	if( m_pAbilityPool )
		m_pAbilityPool->Release();
}

VOID AbilityFactory::Init( DWORD dwMaxPoolSize )
{
	m_pAbilityPool->Initialize( dwMaxPoolSize, dwMaxPoolSize/2+1 );
}

Ability * AbilityFactory::AllocAbility()
{
	return m_pAbilityPool->Alloc();
}


VOID AbilityFactory::FreeAbility( Ability* pAbility )
{
	m_pAbilityPool->Free( pAbility );
}



